import Vue from 'vue'
import _ from 'lodash'
import {
    SET_SETTING_INFO,
    SET_CURR_SETTING_ID
} from './mutations-types'

export default {
    [SET_SETTING_INFO](state, payload) {
        // if (payload.id in state.setting) {
        //     state.setting[payload.id] = _.assign(state.setting[payload.id], payload)
        // } else {
        //     Vue.set(state.setting, payload.id, payload)
        // }
        Vue.set(state.setting, payload.id, payload)
    },

    [SET_CURR_SETTING_ID](state, payload) {
        state.currSettingId = payload
    }
}